<html>
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
  <meta name="layout" content="main"/>
  <title>Create UserInfo</title>
</head>
<body>
<div class="nav">
  <span class="menuButton"><a class="home" href="${resource(dir: '')}">Home</a></span>
  <span class="menuButton"><g:link class="list" action="list">UserInfo List</g:link></span>
</div>
<div class="body">
  <h1>Create UserInfo</h1>
  <g:if test="${flash.message}">
    <div class="message">${flash.message}</div>
  </g:if>
  <g:hasErrors bean="${userInfoInstance}">
    <div class="errors">
      <g:renderErrors bean="${userInfoInstance}" as="list"/>
    </div>
  </g:hasErrors>
  <g:form action="save" method="post">
    <div class="dialog">
      <table>
        <tbody>

        <tr class="prop">
          <td valign="top" class="name">
            <label for="code">Code:</label>
          </td>
          <td valign="top" class="value ${hasErrors(bean: userInfoInstance, field: 'code', 'errors')}">
            <input type="text" maxlength="16" id="code" name="code" value="${fieldValue(bean: userInfoInstance, field: 'code')}"/>
          </td>
        </tr>

        <tr class="prop">
          <td valign="top" class="name">
            <label for="password">Password:</label>
          </td>
          <td valign="top" class="value ${hasErrors(bean: userInfoInstance, field: 'password', 'errors')}">
            <input type="text" maxlength="16" id="password" name="password" value="${fieldValue(bean: userInfoInstance, field: 'password')}"/>
          </td>
        </tr>

        <tr class="prop">
          <td valign="top" class="name">
            <label for="name">Name:</label>
          </td>
          <td valign="top" class="value ${hasErrors(bean: userInfoInstance, field: 'name', 'errors')}">
            <input type="text" maxlength="16" id="name" name="name" value="${fieldValue(bean: userInfoInstance, field: 'name')}"/>
          </td>
        </tr>

        <tr class="prop">
          <td valign="top" class="name">
            <label for="email">Email:</label>
          </td>
          <td valign="top" class="value ${hasErrors(bean: userInfoInstance, field: 'email', 'errors')}">
            <input type="text" id="email" name="email" value="${fieldValue(bean: userInfoInstance, field: 'email')}"/>
          </td>
        </tr>
        <g:if test="${session?.currentUser != null && (session?.currentUser?.id == messageTitleInstance?.userInfo?.id || session?.currentUser?.type =='1' )}">
          <tr class="prop">
            <td valign="top" class="name">
              <label for="orderNum">Order Num:</label>
            </td>
            <td valign="top" class="value ${hasErrors(bean: userInfoInstance, field: 'orderNum', 'errors')}">
              <input type="text" id="orderNum" name="orderNum" value="${fieldValue(bean: userInfoInstance, field: 'orderNum')}"/>
            </td>
          </tr>

          <tr class="prop">
            <td valign="top" class="name">
              <label for="type">Type:</label>
            </td>
            <td valign="top" class="value ${hasErrors(bean: userInfoInstance, field: 'type', 'errors')}">
              <input type="text" id="type" name="type" value="${fieldValue(bean: userInfoInstance, field: 'type')}"/>
            </td>
          </tr>

          <tr class="prop">
            <td valign="top" class="name">
              <label for="authorities">Authorities:</label>
            </td>
            <td valign="top" class="value ${hasErrors(bean: userInfoInstance, field: 'authorities', 'errors')}">
              <g:select name="authorities"
                      from="${Authority.list()}"
                      size="5" multiple="yes" optionKey="id"
                      value="${userInfoInstance?.authorities}" optionValue="name"/>

            </td>
          </tr>

        </g:if>
        <tr class="prop">
          <td valign="top" class="name">
            <label for="creatTime">Creat Time:</label>
          </td>
          <td valign="top" class="value ${hasErrors(bean: userInfoInstance, field: 'creatTime', 'errors')}">
            <g:datePicker name="creatTime" value="${userInfoInstance?.creatTime}" precision="minute"></g:datePicker>
          </td>
        </tr>

        <tr class="prop">
          <td valign="top" class="name">
            <label for="lastModifyTime">Last Modify Time:</label>
          </td>
          <td valign="top" class="value ${hasErrors(bean: userInfoInstance, field: 'lastModifyTime', 'errors')}">
            <g:datePicker name="lastModifyTime" value="${userInfoInstance?.lastModifyTime}" precision="minute"></g:datePicker>
          </td>
        </tr>

        <tr class="prop">
          <td valign="top" class="name">
            <label for="lastLoginTime">Last Login Time:</label>
          </td>
          <td valign="top" class="value ${hasErrors(bean: userInfoInstance, field: 'lastLoginTime', 'errors')}">
            <g:datePicker name="lastLoginTime" value="${userInfoInstance?.lastLoginTime}" precision="minute"></g:datePicker>
          </td>
        </tr>

        <tr class="prop">
          <td valign="top" class="name">
            <label for="fullName">Full Name:</label>
          </td>
          <td valign="top" class="value ${hasErrors(bean: userInfoInstance, field: 'fullName', 'errors')}">
            <input type="text" id="fullName" name="fullName" value="${fieldValue(bean: userInfoInstance, field: 'fullName')}"/>
          </td>
        </tr>

        </tbody>
      </table>
    </div>
    <div class="buttons">
      <span class="button"><input class="save" type="submit" value="Create"/></span>
    </div>
  </g:form>
</div>
</body>
</html>
